home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / mc51bugs / q32556 < prev    next >
Text File  |  1988-07-20  |  997b  |  41 lines

  1. Q32556 Incorrect Code with /AH and Address Addition
  2. C Compiler
  3. 5.10   | 5.10
  4. MS-DOS | OS/2
  5.  
  6. Summary:
  7.    The code generated for the example below is incorrect when compiled
  8. with /AH /Od. The code generated for this instruction:
  9.  
  10. *((BYTE *)&count+2
  11.  
  12. loads the bx register and then immediately overwrites it with the
  13. mov bx,ss instruction.
  14.  
  15.    Microsoft has confirmed this to be a problem in Version 5.10 of the
  16. C compiler. We are researching this problem and will post new
  17. information as it becomes available.
  18.    You can work around this problem by removing one of the register
  19. int declarations.
  20.  
  21. More Information:
  22.    The following is an example:
  23.  
  24. typedef unsigned char BYTE;
  25.  
  26. void nserver()
  27. {
  28.         register int    iostatus;
  29.         register int    psn;
  30.         long                    count;
  31.  
  32.         psn = 10;
  33.         iostatus = 20;
  34.         count = *((BYTE *)&count+3) | *((BYTE *)&count+2) << 8;
  35. }
  36.  
  37.  
  38.  
  39. Keywords:  buglist5.10 qfbv
  40. Updated  88/07/21 03:19
  41.